<!doctype html>
<html lang="zh">
  <head>
    <meta charset="UTF-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>高级本地混流预览系统</title>
    <!-- 放宽 CSP 以允许加载腾讯云 SDK -->
    <meta
      http-equiv="Content-Security-Policy"
      content="default-src 'self'; script-src 'self' 'unsafe-inline' 'unsafe-eval' https://video.sdk.qcloudecdn.com https://web.sdk.qcloud.com https://cdn.jsdelivr.net; style-src 'self' 'unsafe-inline' https://web.sdk.qcloud.com; img-src 'self' data: https:; connect-src 'self' https: wss: ws: webrtc:; media-src 'self' blob: mediastream:"
    />
    <!-- 腾讯云播放器 CSS -->
    <link href="https://web.sdk.qcloud.com/player/tcplayer/release/v5.0.0/tcplayer.v5.0.0.min.css" rel="stylesheet">
  </head>

  <body>
    <div id="app"></div>
    
    <!-- 腾讯云 SDK 按顺序加载 -->
    <script>
      // SDK 加载状态
      window.sdkLoadStatus = {
        pusher: false,
        player: false
      };

      // 检查所有 SDK 是否加载完成
      window.checkSDKReady = function() {
        return window.sdkLoadStatus.pusher && window.sdkLoadStatus.player;
      };
    </script>

    <!-- 腾讯云直播推流 SDK -->
    <script 
      src="https://video.sdk.qcloudecdn.com/web/TXLivePusher-2.1.1.min.js"
      onload="window.sdkLoadStatus.pusher = true; console.log('✅ TXLivePusher SDK 加载完成');"
      onerror="console.error('❌ TXLivePusher SDK 加载失败');"
    ></script>

    <!-- 腾讯云播放器 SDK -->
    <script 
      src="https://web.sdk.qcloud.com/player/tcplayer/release/v5.0.0/tcplayer.v5.0.0.min.js"
      onload="window.sdkLoadStatus.player = true; console.log('✅ TCPlayer SDK 加载完成');"
      onerror="console.error('❌ TCPlayer SDK 加载失败');"
    ></script>

    <!-- Vue 应用 -->
    <script type="module" src="/src/main.js"></script>
  </body>
</html>
